Skip to content

feat(components): add Slider components#1942

Open
zakk-verrilli-ld wants to merge 1 commit into
mainfrom
zverrilli/react-aria-component-gaps
Open

feat(components): add Slider components#1942
zakk-verrilli-ld wants to merge 1 commit into
mainfrom
zverrilli/react-aria-component-gaps

Conversation

@zakk-verrilli-ld

@zakk-verrilli-ld zakk-verrilli-ld commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes the React Aria Components gap for range selection by adding Slider, SliderTrack, SliderThumb, SliderFill, and SliderOutput to @launchpad-ui/components.

  • Thin, themed wrappers over the RAC primitives following the composable Calendar/Select/DatePicker precedent — each is a composeRenderProps + cva shell; keyboard/ARIA/focus/drag behavior stays in RAC.
  • Slider uses the useLPContextProps + SliderContext pattern for overridable props.
  • Supports single and range values (one SliderThumb per state.values entry) and horizontal + vertical orientation ([data-orientation] CSS, not a cva variant).
  • Styling uses --lp-* tokens exclusively and works in light + dark. A single --slider-track-size variable drives the rail/fill thickness and the thumb diameter (* 2.5), so the thumb scales with the track. The track element itself is the rail (RAC forces the fill to height: 100%), and the thumb is centered on the cross axis (top/left: 50%) to complement RAC's translate(-50%, -50%).

Screenshots

Screenshot 2026-07-01 at 12 07 12 PM

Testing approaches

  • Added Slider.spec.tsx: single-thumb composition, range (two thumbs), and disabled state — all passing.
  • Added Slider.stories.tsx for discoverability + Chromatic + axe (every story has an accessible name via <Label> or aria-label).
  • pnpm biome check clean; package builds/typechecks via tsc --project tsconfig.build.json.

Note

Low Risk
Additive UI-only API with no changes to existing components; behavior and a11y are delegated to React Aria.

Overview
Adds composable Slider primitives to @launchpad-ui/components (Slider, SliderTrack, SliderThumb, SliderFill, SliderOutput), exported from the package with a minor changeset.

The implementation wraps React Aria Slider with Launchpad styling (cva + CSS modules using --lp-* tokens). Slider uses SliderContext and useLPContextProps like other form controls. Consumers compose track, fill, thumb(s), optional SliderOutput, and Label for naming; range sliders render one thumb per value via SliderTrack render props.

Styling supports horizontal and vertical orientation via [data-orientation], disabled/hover/focus states, and proportional sizing from --slider-track-size. Tests cover single value, range, and disabled; Storybook documents common patterns including formatted values.

Reviewed by Cursor Bugbot for commit 5100863. Bugbot is set up for automated code reviews on this repo. Configure here.

Add Slider, SliderTrack, SliderThumb, SliderFill, and SliderOutput,
closing the React Aria Components gap for range selection. Supports
single and range values, horizontal and vertical orientation, and a
--slider-track-size variable so the thumb scales with the track.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-new Bot commented Jul 1, 2026

Copy link
Copy Markdown
yarn add https://pkg.pr.new/@launchpad-ui/components@1942.tgz
yarn add https://pkg.pr.new/@launchpad-ui/icons@1942.tgz
yarn add https://pkg.pr.new/@launchpad-ui/tokens@1942.tgz

commit: 5100863

@zakk-verrilli-ld zakk-verrilli-ld marked this pull request as ready for review July 1, 2026 16:10
@zakk-verrilli-ld zakk-verrilli-ld requested a review from a team as a code owner July 1, 2026 16:10

@nhironaka nhironaka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested keyboard accessibility and it worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants